package com.example.mybatis;

import com.example.mybatis.service.AccountService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:testSM
 * Package:com.example.mybatis
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/12-11:03
 * @Version:v1.0
 */
public class testSM {
    @Test
    void name() {
    }

    @Test
    void testSM() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-mybatis.xml");
        AccountService accountService = applicationContext.getBean("accountService", AccountService.class);

        try{
            accountService.transfer("act-001","act-002",10000.0);
            System.out.println("转账成功");
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
